@extends('admin.formLayout')

    @section('title','授予权限')
@section('barName','授予权限')
@section('content')
    <form class="layui-form"  action="{{route('admin.role_permission_store')}}"  method="post">
    {{csrf_field()}}
        <input type="hidden" value="{{$id}}" name="id">
        @foreach($permission as $k=>$v)
        <div class="layui-form-item">
            <label class="layui-form-label">{{$k}}</label>
            <div class="layui-input-block">
                @foreach($v as $vv)
                <input type="checkbox" name="permission[]" value="{{$vv->name}}" title="{{$vv->desc}}" @if(in_array($vv->name,$rolePermission)) checked @endif>
             @endforeach
            </div>
        </div>
        @endforeach
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="form">立即提交</button>
                <button onclick="location.href='{{route('admin.role_index')}}'" class="layui-btn">返回</button>
            </div>
        </div>
    </form>
    @endsection